﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace B.W.traceability.Infrastructure.Migrations
{
    public partial class _32423 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "cultivation",
                columns: table => new
                {
                    cultivationid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    cultivationName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    cultivationCigou = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    cultivationSiyang = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    cultivationPinpai = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    cultivationFuzheren = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    cultivationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_cultivation", x => x.cultivationid);
                });

            migrationBuilder.CreateTable(
                name: "Deepwork",
                columns: table => new
                {
                    Deepworkid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Traceabilityid = table.Column<int>(type: "int", nullable: false),
                    DeepworkName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Traceabilitypermit = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Deepwork", x => x.Deepworkid);
                });

            migrationBuilder.CreateTable(
                name: "enterprise",
                columns: table => new
                {
                    enterpriseid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    enterpriseChang = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    enterpriseName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    enterpriseNum = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_enterprise", x => x.enterpriseid);
                });

            migrationBuilder.CreateTable(
                name: "enterprises",
                columns: table => new
                {
                    enterprisesid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    enterprisesName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    enterprisesdateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    enterprisesaddress = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    enterprisesJianjie = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_enterprises", x => x.enterprisesid);
                });

            migrationBuilder.CreateTable(
                name: "immunity",
                columns: table => new
                {
                    cultivationTime = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    cultivationMianyifangshi = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    cultivationMainfanfangfa = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_immunity", x => x.cultivationTime);
                });

            migrationBuilder.CreateTable(
                name: "produce",
                columns: table => new
                {
                    produceid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    produceNice = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    produceName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_produce", x => x.produceid);
                });

            migrationBuilder.CreateTable(
                name: "slaughter",
                columns: table => new
                {
                    slaughterid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Traceabilityid = table.Column<int>(type: "int", nullable: false),
                    TraceabilityDateTime = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    slaughterTizhong = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    slaughterDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    slaughterTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_slaughter", x => x.slaughterid);
                });

            migrationBuilder.CreateTable(
                name: "TraceabilityNames",
                columns: table => new
                {
                    TraceabilityNamesid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TraceabilityNamesNice = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TraceabilityNames", x => x.TraceabilityNamesid);
                });

            migrationBuilder.CreateTable(
                name: "Traceabilitytable",
                columns: table => new
                {
                    Traceabilityid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TraceabilityNamesid = table.Column<int>(type: "int", nullable: false),
                    TraceabilityDateTime = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    TraceabilityDate = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Traceabilitypermit = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    enterprise = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Image = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Traceabilitytable", x => x.Traceabilityid);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "cultivation");

            migrationBuilder.DropTable(
                name: "Deepwork");

            migrationBuilder.DropTable(
                name: "enterprise");

            migrationBuilder.DropTable(
                name: "enterprises");

            migrationBuilder.DropTable(
                name: "immunity");

            migrationBuilder.DropTable(
                name: "produce");

            migrationBuilder.DropTable(
                name: "slaughter");

            migrationBuilder.DropTable(
                name: "TraceabilityNames");

            migrationBuilder.DropTable(
                name: "Traceabilitytable");
        }
    }
}
